/***************************************************************
 * Name:      NominasPAIEDAMain.cpp
 * Purpose:   Code for Application Frame
 * Author:    JUakine,Bukk,NoMezale ()
 * Created:   2012-11-23
 * Copyright: JUakine,Bukk,NoMezale ()
 * License:
 **************************************************************/
//#include <sqlapi.h>
//#include "cola.h"
//#include "Nomina.h"
//#include "Error.h"
//#include "ErrorCampos.h"
#include "NominasPAIEDAMain.h"
#include <wx/msgdlg.h>
//(*InternalHeaders(NominasPAIEDAFrame)
#include <wx/font.h>
#include <wx/intl.h>
#include <wx/string.h>
#include <sqlapi.h>
#include "cola.h"
#include "Nomina.h"
#include "Error.h"
#include "ErrorCampos.h"
//*)


int i=0;
struct nodo *empleados;
struct nodo *primero;
//char espacio0[2]=" ";
wxString espacio(" ", wxConvUTF8);
wxString msg("NO HAY EMPLEADOS ", wxConvUTF8);
//helper functions
enum wxbuildinfoformat {
    short_f, long_f };

wxString wxbuildinfo(wxbuildinfoformat format)
{
    wxString wxbuild(wxVERSION_STRING);

    if (format == long_f )
    {
#if defined(__WXMSW__)
        wxbuild << _T("-Windows");
#elif defined(__UNIX__)
        wxbuild << _T("-Linux");
#endif

#if wxUSE_UNICODE
        wxbuild << _T("-Unicode build");
#else
        wxbuild << _T("-ANSI build");
#endif // wxUSE_UNICODE
    }

    return wxbuild;
}


//(*IdInit(NominasPAIEDAFrame)
const long NominasPAIEDAFrame::ID_STATICTEXT1 = wxNewId();
const long NominasPAIEDAFrame::ID_ListaEmplea = wxNewId();
const long NominasPAIEDAFrame::ID_BtnCargar = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT2 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT3 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT4 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT5 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT6 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT7 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT8 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT9 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT10 = wxNewId();
const long NominasPAIEDAFrame::ID_EmpleNombre = wxNewId();
const long NominasPAIEDAFrame::ID_EmpleApellidos = wxNewId();
const long NominasPAIEDAFrame::ID_EmpleSS = wxNewId();
const long NominasPAIEDAFrame::ID_EmpleDireccion = wxNewId();
const long NominasPAIEDAFrame::ID_EmpleTelefono = wxNewId();
const long NominasPAIEDAFrame::ID_EmpleCB = wxNewId();
const long NominasPAIEDAFrame::ID_EmpleSB = wxNewId();
const long NominasPAIEDAFrame::ID_EmpleHE = wxNewId();
const long NominasPAIEDAFrame::ID_EmpleFA = wxNewId();
const long NominasPAIEDAFrame::ID_BtnInsertar = wxNewId();
const long NominasPAIEDAFrame::ID_BtnNomina = wxNewId();
const long NominasPAIEDAFrame::ID_STATICBOX1 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT11 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT12 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT13 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT14 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT15 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT16 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT17 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT18 = wxNewId();
const long NominasPAIEDAFrame::ID_InsNombre = wxNewId();
const long NominasPAIEDAFrame::ID_InsApellidos = wxNewId();
const long NominasPAIEDAFrame::ID_InsDireccion = wxNewId();
const long NominasPAIEDAFrame::ID_InsTelefono = wxNewId();
const long NominasPAIEDAFrame::ID_InsSS = wxNewId();
const long NominasPAIEDAFrame::ID_InsFA = wxNewId();
const long NominasPAIEDAFrame::ID_InsCB = wxNewId();
const long NominasPAIEDAFrame::ID_InsSB = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT19 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICBOX2 = wxNewId();
const long NominasPAIEDAFrame::ID_BtnDatos = wxNewId();
const long NominasPAIEDAFrame::ID_BtnBuscar = wxNewId();
const long NominasPAIEDAFrame::ID_CasBuscar = wxNewId();
const long NominasPAIEDAFrame::ID_STATICBOX3 = wxNewId();
const long NominasPAIEDAFrame::ID_BUTTON1 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT21 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT20 = wxNewId();
const long NominasPAIEDAFrame::ID_STATICTEXT22 = wxNewId();
const long NominasPAIEDAFrame::ID_TEXTCTRL1 = wxNewId();
const long NominasPAIEDAFrame::ID_TEXTCTRL2 = wxNewId();
const long NominasPAIEDAFrame::ID_TEXTCTRL3 = wxNewId();
const long NominasPAIEDAFrame::ID_PANEL1 = wxNewId();
const long NominasPAIEDAFrame::idMenuQuit = wxNewId();
const long NominasPAIEDAFrame::idMenuAbout = wxNewId();
const long NominasPAIEDAFrame::ID_STATUSBAR1 = wxNewId();
//*)

BEGIN_EVENT_TABLE(NominasPAIEDAFrame,wxFrame)
    //(*EventTable(NominasPAIEDAFrame)
    //*)
END_EVENT_TABLE()

NominasPAIEDAFrame::NominasPAIEDAFrame(wxWindow* parent,wxWindowID id)
{

    //(*Initialize(NominasPAIEDAFrame)
    wxMenuItem* MenuItem2;
    wxMenuItem* MenuItem1;
    wxMenu* Menu1;
    wxMenuBar* MenuBar1;
    wxMenu* Menu2;

    Create(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY"));
    SetClientSize(wxSize(912,620));
    Move(wxPoint(200,50));
    SetMaxSize(wxSize(-1,-1));
    Panel1 = new wxPanel(this, ID_PANEL1, wxDLG_UNIT(this,wxPoint(128,90)), wxSize(912,620), wxTAB_TRAVERSAL, _T("ID_PANEL1"));
    Panel1->SetForegroundColour(wxColour(5,197,231));
    Panel1->SetBackgroundColour(wxColour(32,32,50));
    StaticText1 = new wxStaticText(Panel1, ID_STATICTEXT1, _(" EMPLEADOS PAI-EDA"), wxPoint(16,24), wxDefaultSize, 0, _T("ID_STATICTEXT1"));
    StaticText1->SetForegroundColour(wxColour(75,197,190));
    wxFont StaticText1Font(26,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Cooper Black"),wxFONTENCODING_DEFAULT);
    StaticText1->SetFont(StaticText1Font);
    listaemplea = new wxListBox(Panel1, ID_ListaEmplea, wxPoint(32,152), wxSize(168,304), 0, 0, 0, wxDefaultValidator, _T("ID_ListaEmplea"));
    listaemplea->SetForegroundColour(wxColour(255,255,255));
    listaemplea->SetBackgroundColour(wxColour(32,32,32));
    wxFont listaempleaFont(8,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT);
    listaemplea->SetFont(listaempleaFont);
    btncargar = new wxButton(Panel1, ID_BtnCargar, _("Ver Empleados"), wxPoint(32,112), wxSize(168,31), 0, wxDefaultValidator, _T("ID_BtnCargar"));
    btncargar->SetForegroundColour(wxColour(0,0,0));
    btncargar->SetBackgroundColour(wxColour(19,214,230));
    wxFont btncargarFont(11,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Cooper Black"),wxFONTENCODING_DEFAULT);
    btncargar->SetFont(btncargarFont);
    StaticText2 = new wxStaticText(Panel1, ID_STATICTEXT2, _("Nombre:"), wxPoint(216,176), wxDefaultSize, 0, _T("ID_STATICTEXT2"));
    wxFont StaticText2Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Arial"),wxFONTENCODING_DEFAULT);
    StaticText2->SetFont(StaticText2Font);
    StaticText3 = new wxStaticText(Panel1, ID_STATICTEXT3, _("Apellidos:"), wxPoint(216,208), wxDefaultSize, 0, _T("ID_STATICTEXT3"));
    wxFont StaticText3Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText3->SetFont(StaticText3Font);
    StaticText4 = new wxStaticText(Panel1, ID_STATICTEXT4, _("S.S: "), wxPoint(216,304), wxDefaultSize, 0, _T("ID_STATICTEXT4"));
    wxFont StaticText4Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText4->SetFont(StaticText4Font);
    StaticText5 = new wxStaticText(Panel1, ID_STATICTEXT5, _("Direccion: "), wxPoint(216,240), wxDefaultSize, 0, _T("ID_STATICTEXT5"));
    wxFont StaticText5Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText5->SetFont(StaticText5Font);
    StaticText6 = new wxStaticText(Panel1, ID_STATICTEXT6, _("Telefono: "), wxPoint(216,272), wxDefaultSize, 0, _T("ID_STATICTEXT6"));
    wxFont StaticText6Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText6->SetFont(StaticText6Font);
    StaticText7 = new wxStaticText(Panel1, ID_STATICTEXT7, _("Salario Base:"), wxPoint(216,400), wxDefaultSize, 0, _T("ID_STATICTEXT7"));
    wxFont StaticText7Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText7->SetFont(StaticText7Font);
    StaticText8 = new wxStaticText(Panel1, ID_STATICTEXT8, _("Horas Extras:"), wxPoint(216,432), wxDefaultSize, 0, _T("ID_STATICTEXT8"));
    wxFont StaticText8Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText8->SetFont(StaticText8Font);
    StaticText9 = new wxStaticText(Panel1, ID_STATICTEXT9, _("C. Bancaria: "), wxPoint(216,368), wxDefaultSize, 0, _T("ID_STATICTEXT9"));
    wxFont StaticText9Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText9->SetFont(StaticText9Font);
    StaticText10 = new wxStaticText(Panel1, ID_STATICTEXT10, _("Fecha Alta:"), wxPoint(216,336), wxDefaultSize, 0, _T("ID_STATICTEXT10"));
    wxFont StaticText10Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText10->SetFont(StaticText10Font);
    emplenombre = new wxTextCtrl(Panel1, ID_EmpleNombre, wxEmptyString, wxPoint(312,176), wxSize(200,21), 0, wxDefaultValidator, _T("ID_EmpleNombre"));
    wxFont emplenombreFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    emplenombre->SetFont(emplenombreFont);
    empleapellidos = new wxTextCtrl(Panel1, ID_EmpleApellidos, wxEmptyString, wxPoint(312,208), wxSize(96,21), 0, wxDefaultValidator, _T("ID_EmpleApellidos"));
    wxFont empleapellidosFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    empleapellidos->SetFont(empleapellidosFont);
    empless = new wxTextCtrl(Panel1, ID_EmpleSS, wxEmptyString, wxPoint(312,304), wxSize(200,21), 0, wxDefaultValidator, _T("ID_EmpleSS"));
    wxFont emplessFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    empless->SetFont(emplessFont);
    empledireccion = new wxTextCtrl(Panel1, ID_EmpleDireccion, wxEmptyString, wxPoint(312,240), wxSize(200,21), 0, wxDefaultValidator, _T("ID_EmpleDireccion"));
    wxFont empledireccionFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    empledireccion->SetFont(empledireccionFont);
    empletelefono = new wxTextCtrl(Panel1, ID_EmpleTelefono, wxEmptyString, wxPoint(312,272), wxSize(200,21), 0, wxDefaultValidator, _T("ID_EmpleTelefono"));
    wxFont empletelefonoFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    empletelefono->SetFont(empletelefonoFont);
    emplecb = new wxTextCtrl(Panel1, ID_EmpleCB, wxEmptyString, wxPoint(312,368), wxSize(200,21), 0, wxDefaultValidator, _T("ID_EmpleCB"));
    wxFont emplecbFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    emplecb->SetFont(emplecbFont);
    emplesb = new wxTextCtrl(Panel1, ID_EmpleSB, wxEmptyString, wxPoint(312,400), wxSize(200,21), 0, wxDefaultValidator, _T("ID_EmpleSB"));
    wxFont emplesbFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    emplesb->SetFont(emplesbFont);
    emplehe = new wxTextCtrl(Panel1, ID_EmpleHE, wxEmptyString, wxPoint(312,432), wxSize(200,21), 0, wxDefaultValidator, _T("ID_EmpleHE"));
    wxFont empleheFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    emplehe->SetFont(empleheFont);
    emplefa = new wxTextCtrl(Panel1, ID_EmpleFA, wxEmptyString, wxPoint(312,336), wxSize(200,21), 0, wxDefaultValidator, _T("ID_EmpleFA"));
    wxFont emplefaFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    emplefa->SetFont(emplefaFont);
    btninsertar = new wxButton(Panel1, ID_BtnInsertar, _("Insertar Empleado"), wxPoint(576,472), wxSize(304,39), 0, wxDefaultValidator, _T("ID_BtnInsertar"));
    btninsertar->SetForegroundColour(wxColour(0,0,0));
    btninsertar->SetBackgroundColour(wxColour(19,214,230));
    wxFont btninsertarFont(14,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Cooper Black"),wxFONTENCODING_DEFAULT);
    btninsertar->SetFont(btninsertarFont);
    btnnomina = new wxButton(Panel1, ID_BtnNomina, _("Nomina"), wxPoint(216,472), wxSize(144,40), 0, wxDefaultValidator, _T("ID_BtnNomina"));
    btnnomina->SetForegroundColour(wxColour(0,0,0));
    btnnomina->SetBackgroundColour(wxColour(19,214,230));
    wxFont btnnominaFont(14,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Cooper Black"),wxFONTENCODING_DEFAULT);
    btnnomina->SetFont(btnnominaFont);
    StaticBox1 = new wxStaticBox(Panel1, ID_STATICBOX1, _("Empleados"), wxPoint(16,88), wxSize(512,464), 0, _T("ID_STATICBOX1"));
    StaticBox1->SetForegroundColour(wxColour(251,75,45));
    StaticText11 = new wxStaticText(Panel1, ID_STATICTEXT11, _("Nombre:"), wxPoint(576,176), wxDefaultSize, 0, _T("ID_STATICTEXT11"));
    wxFont StaticText11Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Arial"),wxFONTENCODING_DEFAULT);
    StaticText11->SetFont(StaticText11Font);
    StaticText12 = new wxStaticText(Panel1, ID_STATICTEXT12, _("Apellidos:"), wxPoint(576,208), wxDefaultSize, 0, _T("ID_STATICTEXT12"));
    wxFont StaticText12Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText12->SetFont(StaticText12Font);
    StaticText13 = new wxStaticText(Panel1, ID_STATICTEXT13, _("Direccion:"), wxPoint(576,272), wxDefaultSize, 0, _T("ID_STATICTEXT13"));
    wxFont StaticText13Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText13->SetFont(StaticText13Font);
    StaticText14 = new wxStaticText(Panel1, ID_STATICTEXT14, _("Telefono:"), wxPoint(576,304), wxDefaultSize, 0, _T("ID_STATICTEXT14"));
    wxFont StaticText14Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText14->SetFont(StaticText14Font);
    StaticText15 = new wxStaticText(Panel1, ID_STATICTEXT15, _("SS:"), wxPoint(576,336), wxDefaultSize, 0, _T("ID_STATICTEXT15"));
    wxFont StaticText15Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText15->SetFont(StaticText15Font);
    StaticText16 = new wxStaticText(Panel1, ID_STATICTEXT16, _("Fecha Alta:"), wxPoint(576,368), wxDefaultSize, 0, _T("ID_STATICTEXT16"));
    wxFont StaticText16Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText16->SetFont(StaticText16Font);
    StaticText17 = new wxStaticText(Panel1, ID_STATICTEXT17, _("C. Bancaria:"), wxPoint(576,400), wxDefaultSize, 0, _T("ID_STATICTEXT17"));
    wxFont StaticText17Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText17->SetFont(StaticText17Font);
    StaticText18 = new wxStaticText(Panel1, ID_STATICTEXT18, _("Salario Base:"), wxPoint(576,432), wxDefaultSize, 0, _T("ID_STATICTEXT18"));
    wxFont StaticText18Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText18->SetFont(StaticText18Font);
    insnombre = new wxTextCtrl(Panel1, ID_InsNombre, wxEmptyString, wxPoint(680,176), wxSize(200,21), 0, wxDefaultValidator, _T("ID_InsNombre"));
    wxFont insnombreFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    insnombre->SetFont(insnombreFont);
    insape1 = new wxTextCtrl(Panel1, ID_InsApellidos, wxEmptyString, wxPoint(680,208), wxSize(96,21), 0, wxDefaultValidator, _T("ID_InsApellidos"));
    wxFont insape1Font(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    insape1->SetFont(insape1Font);
    insdireccion = new wxTextCtrl(Panel1, ID_InsDireccion, wxEmptyString, wxPoint(680,272), wxSize(200,21), 0, wxDefaultValidator, _T("ID_InsDireccion"));
    wxFont insdireccionFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    insdireccion->SetFont(insdireccionFont);
    instelefono = new wxTextCtrl(Panel1, ID_InsTelefono, wxEmptyString, wxPoint(680,304), wxSize(200,21), 0, wxDefaultValidator, _T("ID_InsTelefono"));
    wxFont instelefonoFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    instelefono->SetFont(instelefonoFont);
    insss = new wxTextCtrl(Panel1, ID_InsSS, wxEmptyString, wxPoint(680,336), wxSize(200,21), 0, wxDefaultValidator, _T("ID_InsSS"));
    wxFont insssFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    insss->SetFont(insssFont);
    insfa = new wxTextCtrl(Panel1, ID_InsFA, wxEmptyString, wxPoint(680,368), wxSize(200,21), 0, wxDefaultValidator, _T("ID_InsFA"));
    wxFont insfaFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    insfa->SetFont(insfaFont);
    inscb = new wxTextCtrl(Panel1, ID_InsCB, wxEmptyString, wxPoint(680,400), wxSize(200,21), 0, wxDefaultValidator, _T("ID_InsCB"));
    wxFont inscbFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    inscb->SetFont(inscbFont);
    inssb = new wxTextCtrl(Panel1, ID_InsSB, wxEmptyString, wxPoint(680,432), wxSize(200,21), 0, wxDefaultValidator, _T("ID_InsSB"));
    wxFont inssbFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    inssb->SetFont(inssbFont);
    StaticText19 = new wxStaticText(Panel1, ID_STATICTEXT19, _("Insertar Empleado"), wxPoint(648,112), wxDefaultSize, 0, _T("ID_STATICTEXT19"));
    wxFont StaticText19Font(14,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Cooper Black"),wxFONTENCODING_DEFAULT);
    StaticText19->SetFont(StaticText19Font);
    StaticBox2 = new wxStaticBox(Panel1, ID_STATICBOX2, _("Alta Nueva"), wxPoint(560,88), wxSize(336,464), 0, _T("ID_STATICBOX2"));
    StaticBox2->SetForegroundColour(wxColour(251,75,45));
    btndatos = new wxButton(Panel1, ID_BtnDatos, _("Seleccionar"), wxPoint(32,472), wxSize(168,39), 0, wxDefaultValidator, _T("ID_BtnDatos"));
    btndatos->SetBackgroundColour(wxColour(19,214,230));
    wxFont btndatosFont(14,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Cooper Black"),wxFONTENCODING_DEFAULT);
    btndatos->SetFont(btndatosFont);
    btnbuscar = new wxButton(Panel1, ID_BtnBuscar, _("Buscar"), wxPoint(408,120), wxSize(88,23), 0, wxDefaultValidator, _T("ID_BtnBuscar"));
    btnbuscar->SetBackgroundColour(wxColour(19,214,230));
    wxFont btnbuscarFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Cooper Black"),wxFONTENCODING_DEFAULT);
    btnbuscar->SetFont(btnbuscarFont);
    casbuscar = new wxTextCtrl(Panel1, ID_CasBuscar, wxEmptyString, wxPoint(312,120), wxSize(80,21), 0, wxDefaultValidator, _T("ID_CasBuscar"));
    wxFont casbuscarFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    casbuscar->SetFont(casbuscarFont);
    StaticBox3 = new wxStaticBox(Panel1, ID_STATICBOX3, _("Buscar"), wxPoint(208,104), wxSize(296,48), 0, _T("ID_STATICBOX3"));
    StaticBox3->SetForegroundColour(wxColour(251,75,45));
    btneliminar = new wxButton(Panel1, ID_BUTTON1, _("Eliminar"), wxPoint(376,472), wxSize(136,39), 0, wxDefaultValidator, _T("ID_BUTTON1"));
    btneliminar->SetBackgroundColour(wxColour(19,214,230));
    wxFont btneliminarFont(14,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Cooper Black"),wxFONTENCODING_DEFAULT);
    btneliminar->SetFont(btneliminarFont);
    StaticText21 = new wxStaticText(Panel1, ID_STATICTEXT21, _("CIF:12345678FD\nC/Franco s/n. CP:11402\nJerez de la Frontera\n"), wxPoint(560,16), wxDefaultSize, 0, _T("ID_STATICTEXT21"));
    StaticText20 = new wxStaticText(Panel1, ID_STATICTEXT20, _("Apellido 1:"), wxPoint(216,120), wxDefaultSize, 0, _T("ID_STATICTEXT20"));
    wxFont StaticText20Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText20->SetFont(StaticText20Font);
    StaticText22 = new wxStaticText(Panel1, ID_STATICTEXT22, _("DNI:"), wxPoint(576,240), wxDefaultSize, 0, _T("ID_STATICTEXT22"));
    wxFont StaticText22Font(12,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    StaticText22->SetFont(StaticText22Font);
    insdni = new wxTextCtrl(Panel1, ID_TEXTCTRL1, wxEmptyString, wxPoint(680,240), wxSize(200,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
    wxFont insdniFont(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    insdni->SetFont(insdniFont);
    insape2 = new wxTextCtrl(Panel1, ID_TEXTCTRL2, wxEmptyString, wxPoint(784,208), wxSize(96,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));
    wxFont insape2Font(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    insape2->SetFont(insape2Font);
    empleapellidos2 = new wxTextCtrl(Panel1, ID_TEXTCTRL3, wxEmptyString, wxPoint(416,208), wxSize(96,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL3"));
    wxFont empleapellidos2Font(10,wxSWISS,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
    empleapellidos2->SetFont(empleapellidos2Font);
    MenuBar1 = new wxMenuBar();
    Menu1 = new wxMenu();
    MenuItem1 = new wxMenuItem(Menu1, idMenuQuit, _("Quit\tAlt-F4"), _("Quit the application"), wxITEM_NORMAL);
    Menu1->Append(MenuItem1);
    MenuBar1->Append(Menu1, _("&File"));
    Menu2 = new wxMenu();
    MenuItem2 = new wxMenuItem(Menu2, idMenuAbout, _("About\tF1"), _("Show info about this application"), wxITEM_NORMAL);
    Menu2->Append(MenuItem2);
    MenuBar1->Append(Menu2, _("Help"));
    SetMenuBar(MenuBar1);
    StatusBar1 = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1"));
    int __wxStatusBarWidths_1[1] = { -1 };
    int __wxStatusBarStyles_1[1] = { wxSB_NORMAL };
    StatusBar1->SetFieldsCount(1,__wxStatusBarWidths_1);
    StatusBar1->SetStatusStyles(1,__wxStatusBarStyles_1);
    SetStatusBar(StatusBar1);

    Connect(ID_BtnCargar,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&NominasPAIEDAFrame::OnbtncargarClick);
    Connect(ID_BtnInsertar,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&NominasPAIEDAFrame::OnbtninsertarClick);
    Connect(ID_BtnNomina,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&NominasPAIEDAFrame::OnbtnnominaClick);
    Connect(ID_BtnDatos,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&NominasPAIEDAFrame::OnbtndatosClick);
    Connect(ID_BtnBuscar,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&NominasPAIEDAFrame::OnbtnbuscarClick);
    Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&NominasPAIEDAFrame::OnbtneliminarClick);
    Connect(idMenuQuit,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&NominasPAIEDAFrame::OnQuit);
    Connect(idMenuAbout,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&NominasPAIEDAFrame::OnAbout);
    //*)

    //cargar empleados


    empleados=(struct nodo *)malloc (sizeof(struct nodo));
    primero=(struct nodo *)malloc (sizeof(struct nodo));
    empleados=primero=NULL;

    SAConnection con; // create connection object
    SACommand cmd;

    try
    {
        con.Connect(
            "nominas",     // database name
            "root",   // user name
            "pass",   // password
            SA_MySQL_Client);    //client name
        printf("Conectador a MySQL\n");

        cmd.setConnection(&con);
        cmd.setCommandText("Select * from empleados");
        cmd.Execute();

        while (cmd.FetchNext())
        {
            int id0=cmd["ID"].asLong(); //tipo entero
            SAString dni0 = cmd["DNI"]; //tipo cadena
            SAString nss0 = cmd["NSS"]; //tipo cadena
            SAString nom0 = cmd["NOMBRE"]; //tipo cadena
            SAString ape10 = cmd["APELLIDO1"]; //tipo cadena
            SAString ape20 = cmd["APELLIDO2"]; //tipo cadena
            SAString date0 = cmd["F_COMIENZO"]; //tipo cadena
            SAString tlfn0 = cmd["TELEFONO"]; //tipo cadena
            SAString dire0 = cmd["DIRECCION"]; //tipo cadena
            SAString cb0 = cmd["C_BANCARIA"]; //tipo cadena
            SAString sal0 = cmd["SALARIO_BASE"]; //tipo cadena

            wxString id = wxString::Format(wxT("%i"),id0);
            wxString dni(dni0, wxConvUTF8);                //de string a wxString
            wxString nss(nss0, wxConvUTF8);
            wxString nom(nom0, wxConvUTF8);
            wxString ape1(ape10, wxConvUTF8);
            wxString ape2(ape20, wxConvUTF8);
            wxString date(date0, wxConvUTF8);
            wxString tlfn(tlfn0, wxConvUTF8);
            wxString dire(dire0, wxConvUTF8);
            wxString cb(cb0, wxConvUTF8);
            wxString sal(sal0, wxConvUTF8);;

            struct nodo *nuevo;
            nuevo=(struct nodo *)malloc (sizeof(struct nodo));

            strcpy( nuevo->datid, (const char*)id.mb_str(wxConvUTF8) ); //pasa datos a vector
            strcpy( nuevo->datdni, (const char*)dni.mb_str(wxConvUTF8) ); //pasa datos a vector
            strcpy( nuevo->datnss, (const char*)nss.mb_str(wxConvUTF8) ); //pasa datos a vector
            strcpy( nuevo->datnom, (const char*)nom.mb_str(wxConvUTF8) ); //pasa datos a vector
            strcpy( nuevo->datape1, (const char*)ape1.mb_str(wxConvUTF8) ); //pasa datos a vector
            strcpy( nuevo->datape2, (const char*)ape2.mb_str(wxConvUTF8) ); //pasa datos a vector
            strcpy( nuevo->datdate, (const char*)date.mb_str(wxConvUTF8) ); //pasa datos a vector
            strcpy( nuevo->dattlfn, (const char*)tlfn.mb_str(wxConvUTF8) ); //pasa datos a vector
            strcpy( nuevo->datdire, (const char*)dire.mb_str(wxConvUTF8) ); //pasa datos a vector
            strcpy( nuevo->datcb, (const char*)cb.mb_str(wxConvUTF8) ); //pasa datos a vector
            strcpy( nuevo->datsal, (const char*)sal.mb_str(wxConvUTF8) ); //pasa datos a vector

            insertar(nuevo,&primero,&empleados);

            i++;
        }


        // Disconnect is optional
        // autodisconnect will ocur in destructor if needed
        con.Disconnect();
        printf("Desconectado\n");
    }

    catch(SAException &x)
    {
        try
        {
            // on error rollback changes
            con.Rollback();
        }
        catch(SAException &)
        {
        }
        // print error message
        printf("%s\n", (const char*)x.ErrText());
    }

    //fin carga de empleados
}

NominasPAIEDAFrame::~NominasPAIEDAFrame()
{
    //(*Destroy(NominasPAIEDAFrame)
    //*)
}

void NominasPAIEDAFrame::OnQuit(wxCommandEvent& event)
{
    Close();
}

void NominasPAIEDAFrame::OnAbout(wxCommandEvent& event)
{
    wxString msg = wxbuildinfo(long_f);
    wxMessageBox(msg, _("Welcome to..."));
}

void NominasPAIEDAFrame::OnbtncargarClick(wxCommandEvent& event)
{
    listaemplea->Clear();
        empleados=primero;

    if (empleados!=NULL)
    {
        while (empleados!=NULL)
        {
            wxString dni(empleados->datdni, wxConvUTF8);
            wxString nom(empleados->datnom, wxConvUTF8);
            wxString ape1(empleados->datape1, wxConvUTF8);

            listaemplea->Append(dni+espacio+nom+espacio+ape1);

            empleados=empleados->sig;
        }
    }
    else
    {
        listaemplea->Append(msg);
    }

}
void NominasPAIEDAFrame::OnbtndatosClick(wxCommandEvent& event)
{

        wxString opc=listaemplea->GetStringSelection();

        if (!opc.IsEmpty())
        {
            empleados=primero;

            while (empleados!=NULL)
            {
                wxString seldni(empleados->datdni, wxConvUTF8);
                wxString selnom(empleados->datnom, wxConvUTF8);
                wxString selape1(empleados->datape1, wxConvUTF8);

                if (opc==(seldni+espacio+selnom+espacio+selape1))
                {
                    wxString selnss(empleados->datnss, wxConvUTF8);
                    wxString selape2(empleados->datape2, wxConvUTF8);
                    wxString seldate(empleados->datdate, wxConvUTF8);
                    wxString seltlfn(empleados->dattlfn, wxConvUTF8);
                    wxString seldire(empleados->datdire, wxConvUTF8);
                    wxString selcb(empleados->datcb, wxConvUTF8);
                    wxString selsal(empleados->datsal, wxConvUTF8);

                    emplenombre->SetValue(selnom);
                    empleapellidos->SetValue(selape1);
                    empleapellidos2->SetValue(selape2);
                    empledireccion->SetValue(seldire);
                    empletelefono->SetValue(seltlfn);
                    empless->SetValue(selnss);
                    emplefa->SetValue(seldate);
                    emplecb->SetValue(selcb);
                    emplesb->SetValue(selsal);
                    emplehe->Clear();
                }
                empleados=empleados->sig;
            }
        }
        else
        {
            Error* FrameErr = new Error(0);
            FrameErr->Show();
        }
}

void NominasPAIEDAFrame::OnbtnbuscarClick(wxCommandEvent& event)
{
        listaemplea->Clear();

        int k=0;
        empleados=primero;

        wxString datobusca=casbuscar->GetValue();  //recoge dato de textctrl4

        while (empleados!=NULL)
        {
            wxString apellido1(empleados->datape1, wxConvUTF8);

            if (datobusca==apellido1)
            {
                wxString seldni(empleados->datdni, wxConvUTF8);
                wxString selnom(empleados->datnom, wxConvUTF8);
                wxString selape1(empleados->datape1, wxConvUTF8);

                listaemplea->Append(seldni+espacio+selnom+espacio+selape1);
                k++;
            }
            empleados=empleados->sig;
        }

        if (k==0)
        {
            listaemplea->Append(msg);
        }

}

void NominasPAIEDAFrame::OnbtneliminarClick(wxCommandEvent& event)
{



    wxString eliss=empless->GetValue();

    if (!eliss.IsEmpty())
    {
        listaemplea->Clear();
        char camposs[20];
        strcpy( camposs, (const char*)eliss.mb_str(wxConvUTF8) );

        emplenombre->Clear();
        empleapellidos->Clear();
        empleapellidos2->Clear();
        empledireccion->Clear();
        empletelefono->Clear();
        empless->Clear();
        emplefa->Clear();
        emplecb->Clear();
        emplesb->Clear();
        emplehe->Clear();

        empleados=primero;
        eliminar(&primero,&empleados,camposs);

        if (empleados!=NULL)
        {
            while (empleados!=NULL)
            {
                wxString dni(empleados->datdni, wxConvUTF8);
                wxString nom(empleados->datnom, wxConvUTF8);
                wxString ape1(empleados->datape1, wxConvUTF8);

                listaemplea->Append(dni+espacio+nom+espacio+ape1);

                empleados=empleados->sig;
            }
        }
        else
        {
            listaemplea->Append(msg);
        }



        SAConnection con; // create connection object
        SACommand cmd;

        try
        {
            con.Connect(
                "nominas",     // database name
                "root",   // user name
                "pass",   // password
                SA_MySQL_Client);    //client name

            printf("Conectador a MySQL\n");

            cmd.setConnection(&con);
            cmd.setCommandText("DELETE FROM empleados WHERE NSS=:1");
            cmd.Param(1).setAsString()=camposs;
            cmd.Execute();

            // Disconnect is optional
            // autodisconnect will ocur in destructor if needed
            con.Disconnect();
            printf("Desconectado\n");

        }

        catch(SAException &x)
        {
            try
            {
                // on error rollback changes
                con.Rollback();
            }
            catch(SAException &)
            {
            }
            // print error message
            printf("%s\n", (const char*)x.ErrText());
        }
    }
    else
    {
       	Error* FrameErr = new Error(0);
        FrameErr->Show();
    }
}

void NominasPAIEDAFrame::OnbtninsertarClick(wxCommandEvent& event)
{


   wxString nom0=insnombre->GetValue();
   wxString ape10=insape1->GetValue();
   wxString ape20=insape2->GetValue();
   wxString dni0=insdni->GetValue();
   wxString dire0=insdireccion->GetValue();
   wxString tlfn0=instelefono->GetValue();
   wxString ss0=insss->GetValue();
   wxString fa0=insfa->GetValue();
   wxString cb0=inscb->GetValue();
   wxString sb0=inssb->GetValue();

    if (!nom0.IsEmpty() && !ape10.IsEmpty() && !ape20.IsEmpty() && !dni0.IsEmpty() && !dire0.IsEmpty() && !tlfn0.IsEmpty() && !ss0.IsEmpty() && !fa0.IsEmpty() && !sb0.IsEmpty() && !cb0.IsEmpty())
    {

        struct nodo *nuevo;
        nuevo=(struct nodo *)malloc (sizeof(struct nodo));

        strcpy( nuevo->datdni, (const char*)dni0.mb_str(wxConvUTF8) );
        strcpy( nuevo->datnss, (const char*)ss0.mb_str(wxConvUTF8) );
        strcpy( nuevo->datnom, (const char*)nom0.mb_str(wxConvUTF8) );
        strcpy( nuevo->datape1, (const char*)ape10.mb_str(wxConvUTF8) );
        strcpy( nuevo->datape2, (const char*)ape20.mb_str(wxConvUTF8) );
        strcpy( nuevo->datdate, (const char*)fa0.mb_str(wxConvUTF8) );
        strcpy( nuevo->dattlfn, (const char*)tlfn0.mb_str(wxConvUTF8) );
        strcpy( nuevo->datdire, (const char*)dire0.mb_str(wxConvUTF8) );
        strcpy( nuevo->datcb, (const char*)cb0.mb_str(wxConvUTF8) );
        strcpy( nuevo->datsal, (const char*)sb0.mb_str(wxConvUTF8) );

        empleados=primero;
        insertar(nuevo,&primero,&empleados);

        insnombre->Clear();
        insape1->Clear();
        insape2->Clear();
        insdireccion->Clear();
        insdni->Clear();
        instelefono->Clear();
        insss->Clear();
        insfa->Clear();
        inscb->Clear();
        inssb->Clear();

        listaemplea->Clear();

        while (empleados!=NULL)
        {
            wxString dni(empleados->datdni, wxConvUTF8);
            wxString nom(empleados->datnom, wxConvUTF8);
            wxString ape1(empleados->datape1, wxConvUTF8);

            listaemplea->Append(dni+espacio+nom+espacio+ape1);

            empleados=empleados->sig;
        }

        SAConnection con; // create connection object
        SACommand cmd;

        try
        {
            con.Connect(
                "nominas",     // database name
                "root",   // user name
                "pass",   // password
                SA_MySQL_Client);    //client name
            printf("Conectador a MySQL\n");

            cmd.setConnection(&con);

            cmd.setCommandText("INSERT INTO empleados(DNI,NSS,NOMBRE,APELLIDO1,APELLIDO2,F_COMIENZO,TELEFONO,DIRECCION,C_BANCARIA,SALARIO_BASE) VALUES (:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)");

            cmd.Param(2).setAsString()=(nuevo->datdni);
            cmd.Param(3).setAsString()=(nuevo->datnss);
            cmd.Param(4).setAsString()=(nuevo->datnom);
            cmd.Param(5).setAsString()=(nuevo->datape1);
            cmd.Param(6).setAsString()=(nuevo->datape2);
            cmd.Param(7).setAsString()=(nuevo->datdate);
            cmd.Param(8).setAsString()=(nuevo->dattlfn);
            cmd.Param(9).setAsString()=(nuevo->datdire);
            int cuenta=atoi(nuevo->datcb);
            int salario=atoi(nuevo->datsal);
            cmd.Param(10).setAsLong()=cuenta;
            cmd.Param(11).setAsLong()=salario;

            cmd.Execute();

            // Disconnect is optional
            // autodisconnect will ocur in destructor if needed
            con.Disconnect();
            printf("Desconectado\n");
        }

        catch(SAException &x)
        {
            printf("%s\n", (const char*)x.ErrText());
            try
            {

                // on error rollback changes
                con.Rollback();
            }
            catch(SAException &)
            {
            }
            // print error message
            printf("%s\n", (const char*)x.ErrText());
        }
    }
    else
    {
        ErrorCampos* FrameErrCamp = new ErrorCampos(0);
        FrameErrCamp->Show();
    }

}


void NominasPAIEDAFrame::OnbtnnominaClick(wxCommandEvent& event)
{
    wxString ss=empless->GetValue();

    if (!ss.IsEmpty())
    {
        Nomina* Frame = new Nomina(0);
        Frame->Show();

        wxString trabajador("Trabajador: ", wxConvUTF8);
        wxString nif("NIF: ", wxConvUTF8);
        wxString nss("Numero Afiliacion S.S.: ", wxConvUTF8);
        wxString fa("Fecha Antiguedad: ", wxConvUTF8);
        wxString gc("Grupo de Cotizacion: 08 ", wxConvUTF8);


        wxString he=emplehe->GetValue();

        empleados=primero;

        while (empleados!=NULL)
        {
            wxString sslist(empleados->datnss, wxConvUTF8);

            if (sslist==ss)
            {
                wxString dni(empleados->datdni, wxConvUTF8);
                wxString nom(empleados->datnom, wxConvUTF8);
                wxString ape1(empleados->datape1, wxConvUTF8);
                wxString ape2(empleados->datape2, wxConvUTF8);
                wxString dire(empleados->datdire, wxConvUTF8);
                wxString sal(empleados->datsal, wxConvUTF8);
                wxString date(empleados->datdate, wxConvUTF8);
                //datos
                Frame->nom->SetLabel(trabajador+nom+espacio+ape1+espacio+ape2);
                Frame->nif->SetLabel(nif+dni);
                Frame->nss->SetLabel(nss+ss);
                Frame->gc->SetLabel(gc);
                Frame->date->SetLabel(fa+date);
                //devengos
                Frame->salario->SetLabel(sal);
                Frame->extras->SetLabel(he);
                int salar=wxAtoi(sal);
                int horas0=wxAtoi(he);
                int horas=horas0*18;
                int totaldev0=salar+horas;
                wxString totaldev = wxString::Format(wxT("%i"),totaldev0);
                Frame->totaldev->SetLabel(totaldev);
                //irpf
                int salario=atoi(empleados->datsal);
                int irp;
                if (salario<=1250){ wxString deducc("2%", wxConvUTF8);Frame->irpf->SetLabel(deducc);irp=wxAtoi(deducc);}
                if (1250<salario && salario <=1500){wxString deducc("6%", wxConvUTF8);Frame->irpf->SetLabel(deducc); irp=wxAtoi(deducc);}
                if (1500<salario && salario<=1750){wxString deducc("10%", wxConvUTF8);Frame->irpf->SetLabel(deducc);irp=wxAtoi(deducc);}
                if (1750<salario && salario<=2000){wxString deducc("13%", wxConvUTF8);Frame->irpf->SetLabel(deducc);irp=wxAtoi(deducc);}
                if (2000<salario && salario<=2250){wxString deducc("16%", wxConvUTF8);Frame->irpf->SetLabel(deducc);irp=wxAtoi(deducc);}
                if (2250<salario && salario<=2500){wxString deducc("17%", wxConvUTF8);Frame->irpf->SetLabel(deducc);irp=wxAtoi(deducc);}
                if (2500<salario && salario<=3000){wxString deducc("18%", wxConvUTF8);Frame->irpf->SetLabel(deducc);irp=wxAtoi(deducc);}
                if (3000<salario && salario<=3500){wxString deducc("21%", wxConvUTF8);Frame->irpf->SetLabel(deducc);irp=wxAtoi(deducc);}
                if (3500<salario && salario<=8000){wxString deducc("24%", wxConvUTF8);Frame->irpf->SetLabel(deducc);irp=wxAtoi(deducc);}
                if (salario>8000){wxString deducc("27%", wxConvUTF8);Frame->irpf->SetLabel(deducc);irp=wxAtoi(deducc);}

                //total a percibir
                int total00=(totaldev0*irp)/100;
                int total0=totaldev0-total00;
                wxString total = wxString::Format(wxT("%i"),total0);
                Frame->total->SetLabel(total);

            }

            empleados=empleados->sig;
        }
    }
    else
    {
    	Error* FrameErr = new Error(0);
        FrameErr->Show();
    }


}
